home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Ham Radio 2000
/
Ham Radio 2000.iso
/
ham2000
/
fax_sstv
/
wxman20
/
wxman.doc
< prev
next >
Wrap
Text File
|
1994-07-22
|
29KB
|
691 lines
WeatherMan:
A Radiofacsimile Reception Program
for
IBM PCs and Compatibles
Table of Contents
(Find topics by searching for the topic title. Be sure to include the
brackets in the search string.)
[Notice]
[I]...........What Is Wefax?
[II]..........How WeatherMan Works
[III].........Connecting a Radio to a Sound Card
[IV]..........Creating a Configuration File
[V]...........Running WeatherMan
[VI]..........WeatherMan Keyboard Commands
[VII].........The SHOWPIC Program
[VIII]........The RAW2PCX Program
[IX]..........WXDEMO.EXE
[Appendix 1]..Weather Facsimile Frequencies
[Appendix 2]..Troubleshooting Q&A
[Appendix 3]..Supported Sound Cards
[Appendix 4]..About the Sample Pictures
[Notice]
*****
Notice, Part 1-- The Plea for Cold, Hard Cash:
The computer programs and documentation described in this document are
neither free, nor are they in the public domain: they are shareware.
In this particular case, the term "shareware" means that you are welcomed
and encouraged to use the programs for a trial period of not more than 30
days. If, after or during the trial period, you decide to continue
using the programs, you should send a check (drawn on a U.S. bank) or
a U.S. Postal Money Order in the amount of $20.00 (US currency) to the
program's author:
Paul Hitchcock
2309 Blake Street, #308
Berkeley, CA 94704
Email about the program may be sent to me at
Internet : paulhtc@netcom.com
Compuserve : 72673,3522
*****
Please note that this program, unlike many other shareware offerings, is
*not* "cripple-ware"-- it is fully functional. While it's true that
offering a limited version of a program via shareware might be an incentive
for users to register, I've always disliked the practice. However,
registered users will go to the "head of the line" as far as support is
concerned.
Notice, Part 2-- The Ugly Legal Stuff:
The programs and documentation in this package are distributed "as-is",
with no warranty expressed or implied, including, but not limited to,
merchantability or fitness for a particular purpose. Any and all
damages arising out of the use of the programs and/or documentation
are the responsibility of the purchaser and/or user of the programs
and documentation.
All programs and documentation in this package are Copyright (C) 1994
by Paul Hitchcock.
"Sound Blaster", "Sound Blaster Pro", and "Sound Blaster 16" are
registered trademarks of Creative Labs, Inc.
"PAS 16" and "ProAudio Spectrum" are registered trademarks of
Mediavision, Inc.
*****
[Introduction]
WeatherMan is a computer program for IBM PCs and compatibles which,
when used with a Sound Blaster-compatible sound card, lets you receive,
display, and store to disk weather photos and charts of the type
broadcast over the high-frequency (HF) shortwave bands.
To use the program you must have the following items:
1) A shortwave receiver, equipped with a beat-frequency
oscillator (BFO)
2) A 100% Sound Blaster-compatible sound card
3) A VGA video card and monitor capable of displaying
640x480 16-color graphics
4) An IBM PC or compatible 386/486 computer, running at
33 MHz or faster
5) A patch cord or microphone for connecting the shortwave
receiver to the sound card
[I] What Is Wefax?
Wefax, or weather facsimile, is a technology for transmitting
photographs and other graphical material via radio. The process
is fairly straightforward: At the transmitter, an object whose
image is to be transmitted is scanned line-by-line at a constant
rate by an optical sensor; the output of the sensor is used to
control the frequency of an oscillator in such a way that the
oscillator's output is linearly proportional to the amount of light
refected from corresponding areas of the scanned object. The
frequency of the oscillator ranges from 1500 Hz for pure-black areas
to 2300 Hz for white regions. This "frequency-modulated subcarrier"
is in turn used to frequency-modulate a radio wave which is then
broadcast.
At the receiver the process is reversed: the wefax signal is
demodulated, resulting in a set of tones whose frequencies
are again linearly proportional to the light and dark areas of the
original scanned object. If an FM receiver is employed to detect
the signal, the original frequencies are faithfully reproduced.
More commonly, however, the signal is demodulated using an AM
receiver equipped with a beat-frequency oscillator (BFO). While
FM reception generally results in better noise rejection, the BFO
method gives the listener the ability to choose (within limits,
of course) the center frequency of the 800 Hz audio band; this
capability can be very useful when trying to receive a fax in
the presence of an interfering signal. BFO-based reception is
assumed throughout the remainder of the discussion.
For the purpose of this discussion, a wefax broadcast can be
defined by two parameters: (1) its transmission rate (or "drum
speed") in lines per minute (lpm) and (2) its index of correlation
(IOC). The IOC is essentially the ratio of the transmitted
picture's line width to its line height. At the present time,
nearly all U.S. (and many foreign) wefax broadcasts are transmitted
with a drum speed of 120 lpm and an IOC of 576. There are a number
of other radiofacsimile formats, but the present version of WeatherMan
can only receive faxes broadcast at 120 lpm.
A more complete description of weather facsimile broadcasting can
be found in the 1990 edition of the ARRL Handbook.
(Note: The term "wefax" is not really appropriate for describing
HF weather facsimile broadcasts, but since "everybody" uses it in
this context, I'll follow the same convention.)
[II] How WeatherMan Works
The digital sound processor (DSP) chip on sound cards such as the
Sound Blaster provides a number of sound-processing services.
One of these services, DMA (Direct Memory Access) audio recording,
may be integrated into a computer program, giving the program the
ability to record audio signals as a background task. WeatherMan
uses this facility to insert a line of radiofax information into a
memory buffer at the same time it is processing and displaying the
previously received line.
Once the radiofax data is in the computer, WeatherMan determines the
frequency of the audio information by measuring the time interval
between consecutive zero-point crossings of the recorded samples.
Once the frequency has been determined, the program assigns a
proportional color number from 0 through 15 to the frequency, plots
the point, then goes back for more samples. This process continues
until the program's user takes some intervening action.
In it's current incarnation, WeatherMan samples the mic input at a
rate of 10,000 samples per second and uses, on average, 8 samples
per pixel. From these numbers, one would assume this would yield a
picture 625 pixels wide (5000 samples per half-second line divided
by 8). Unfortunately, it's not quite that simple, for two principal
reasons: 1) Individual sound card/computer combinations have varying
sampling rates for which allowance must be made, and 2) setting up
and exiting the DMA record procedure requires processor time. Since
the incoming radiofax transmission does not wait for WeatherMan to
complete its internal housekeeping before sending more data, a certain
amount of information is necessarily going to be lost from each received
line. How much data is lost? On average, the amount lost translates to
about two pixels per line.
First, the good news-- although two pixels per line are not plotted,
if the picture being received is properly aligned, no useful information
is lost. The nature of fax transmission requires that data can't
be transmitted over the entire line: for example, a mechanical fax
receiver must be allowed a certain amount of time for the pen or plotting
stylus to return to the margin to begin drawing the next line.
Next, the bad news-- compromises had to be made. In order for
WeatherMan to run on the greatest number of machines, I decided
that the screen resolution should be no greater than 640x480 in
16 colors. Unfortunately, since a vertical resolution of 480 pixels
would result in displaying only a small portion of a weather photo,
I also decided that the program would plot only one line for every
two received. Lines are not skipped, however: a smoothing algorithm
is used on every two received lines to produce a smooth-appearing
single line, which is then plotted. Using this method, about
two-thirds of a complete weather photo can be displayed on a
640/480 screen.
Finally, the completely impartial(but interesting) news-- forget what
was said about white being the highest frequency and black being the
lowest. In commercial fax receivers, those conditions undoubtedly
obtain. However, I found that the best results were achieved when
receiving faxes on the other sideband; hence, WeatherMan employs a
reversed palette in which darker colors represent higher frequencies.
As will be seen later on, WeatherMan's configuration file can be
modified to comply with the "standard" if that's what you need.
[III] Connecting a Radio to a Sound Card
To use WeatherMan, you must connect the audio output of your radio
receiver to the microphone input of your sound card. But first:
*****************************************
* *
* Warning! Warning! Warning! *
* Warning! Warning! Warning! *
* Warning! Warning! Warning! *
* *
*****************************************
Got your attention? Good, because this is very important: unless
you completely understand what you are doing when you connect any
two pieces of electrical equipment together :
THERE IS AN INHERENT RISK OF PERMANENT DAMAGE TO EITHER OR BOTH
DEVICES OR TO YOURSELF!!!!
For people fortunate enough to have a shortwave receiver equipped
with a mic-level output jack, connecting the radio to a sound card
is simply a matter of stringing a patch cord between the microphone
output of the receiver to the microphone input of the sound card.
I have an old, battery-operated Radio Shack DX-440 which I use for
wefax (yes-- it does have a mic output, albeit an undocumented one)
and this method works just fine. But a warning-- if your radio is
powered from the AC line and you're not sure if the radio uses an
internal isolation transformer, DO NOT connect it directly to the
sound card, even if there is an output jack. Use the method below
instead.
The easiest and safest way to connect a sound card to a radio is to
plug a microphone into the card's MIC input, then place the active end
of the microphone *very* close to the radio speaker. Better still, put
the active end of the mike between the earcups of a set of headphones,
then plug the heaphones into the receiver's headphone jack. Secure the
mike in place with rubber bands, use a little scrap foam rubber for sound
baffling and you're in business.
[IV] Using WeatherMan : Creating a Configuration File
Now that your radio and sound card are connected together, there's
one more thing you have to do before running WeatherMan: edit the
program's "configuration file", which holds essential details about
your hardware setup and display preferences. A sample configuration
file is given below (it's a copy of the one supplied with the program
set):
1) 59676 <---------------------- sweep delay number
2) 1050 <---------------------- lowest audio frequency (1050)
3) 1700 <---------------------- highest audio frequency (1700)
4) $220 <---------------------- I/O port used by sound card
5) 5 <---------------------- interrupt used by sound card
6) 1 <---------------------- DMA channel used by sound card
7) 0 63 63 63 <-- <color number> <R> <G> <B>
8) 1 59 59 59 each RGB value must be >= 0 and <= 63
9) 2 55 55 55
10) 3 50 50 50
11) 4 46 46 46
12) 5 42 42 42
13) 6 38 38 38
14) 7 34 34 34
15) 8 29 29 29
16) 9 25 25 25
17) 10 21 21 21
18) 11 17 17 17
19) 12 13 13 13
20) 13 8 8 8
21) 14 5 5 5
22) 15 0 0 0
Let's go through the list (the line numbers, e.g., "20)", are for
reference only and should not appear in the actual configuration file):
Line 1 : "sweep delay number"- This number is used to change the
"tick rate" of the PC's internal time-of-day clock so WeatherMan can
use it as a picture-synchronizing reference. When the proper value for
this number is entered into your configuration file, received pictures
are properly aligned vertically with minimum right/left skewing. The
function of this number is analogous to the "horizontal hold" control
found on older television sets.
How do you know what sweep delay number to use? The number given in
the sample WXMAN.CFG file is only approximate and will probably not
be correct for your setup: you will have to determine the value you
need to use by trial and error. Fortunately, I can offer some
guidelines:
Suppose you are receiving a fax composed of vertical lines that is
supposed to look like this:
| | |
| | |
| | |
| | |
| | |
but instead it looks like this:
\ \ \
\ \ \
\ \ \
\ \ \
\ \ \
In this case, the sweep delay number should be INCREASED by pressing
the plus ("+") key. Note that "+" is entered by pressing the "=" and
SHIFT key simultaneously.
Conversely, if the picture looks like this:
/ / /
/ / /
/ / /
/ / /
/ / /
the sweep delay number should be DECREASED by pressing the minus ("-")
key.
You should only have to adjust the sweep delay number once for a
particular sound card/computer combination. When you exit
WeatherMan, you will be informed of the last sweep delay used by
the program. Insert this number into your WXMAN.CFG file.
Lines 2 and 3: "lowest audio frequency" and "highest audio frequency"--
These define the white-to-black frequency range and have two principal
uses: 1) by widening/narrowing the range, you can stretch/compress the
contrast of the received picture, and 2) by shifting the center of
the range up or down, you can possibly reduce interference caused by
transmissions on adjacent frequencies. Experiment with various
combinations to achieve the best results. The numbers given are
in cycles per second (Hz).
Line 4: Sound card I/O port- If necessary, change this number in
accordance with your particular sound card installation. Consult
your sound card's reference manual for details. Also, note that
the prefacing "$" denotes a hexadecimal number.
Line 5: Sound card interrupt number- Change if necessary, as in Line 4.
Line 6: DMA channel used by the sound card-- Change if necessary, as in
line 4.
Lines 7 through 22: color palette- This is pretty self-explanatory.
The default palette is for a 16-level gray scale.
The format of the configuration file requires that comments be
separated from the file elements by at least one space. The file
should not contain any empty lines.
[V] Running WeatherMan
Once you have created a configuration file, WeatherMan is run using
the following syntax:
WXMAN
or
WXMAN <configuration file name>
If you choose the first option, "WXMAN", you must have a configuration
file with the name "WXMAN.CFG" located in the same directory as the
program file. The second option lets you choose the name and path of
a different configuration file. Suppose, for example, you have a
reversed-palette configuration file named "WXMANREV.CFG" in directory
"CONFIGS" located on drive C:. You then run the program with the
command "WXMAN C:\CONFIGS\WXMANREV.CFG".
With your shortwave receiver turned on and connected to the sound card,
activate the receiver's BFO, then tune in a wefax station. Adjust the
BFO up or down for the best picture. When tuning the BFO, it's usually
easiest to start at a high-frequency audio output and work back to the
proper frequency.
[VI] WeatherMan Keyboard Commands
Once WeatherMan is up and running, you have several commands at your
disposal:
<C>lear Screen
<1>..<9> Delay Picture Reception
<BS> (backspace) Nudge Picture Left/Stop Nudge
<P>osition Graphics Cursor
<G>rab a Picture
<H>elp with Commands
<ESC> Exit WeatherMan
<+/-> increase/decrease sweep delay
Each of the commands is activated by pressing the letter key within
the "<>" symbols. Case is unimportant.
<C>lear Screen
Pressing "C" clears the screen and the current image is
lost forever. After clearing the screen, the picture will
probably have to be re-aligned (see below).
<1>..<9> Delay Picture Reception
Pressing "1" through "9" causes sampling of the incoming
fax to be delayed an amount of time equal to 1-9 "ticks"
of the re-programmed PC real-time clock. Each tick represents
an increment of one-tenth of the horiziontal screen width.
These commands let you "walk" the true edge of the incoming fax
so that it's close to the left side of the screen.
<BS> (backspace) Nudge Picture Left/Stop Nudge
The "1" through "9" keys move the picture to the left only in
discrete amounts, so it's possible that you could move a picture
only to find it doesn't completely align with the left edge of
the monitor screen. In such cases, pressing BS will cause the
picture to start skewing to the left automatically. This key
is a toggle switch-- press it once to start the automatic shift
and when the picture is aligned to your satisfaction, press it
again to stop the motion.
<P>osition Graphics Cursor
After positioning a picture with the "1" through "9" keys,
and/or the BS key, pressing "P" moves the graphics cursor to
the top line of the screen, without clearing the screen.
Previously displayed data will be over-written.
<G>rab a Picture
Pressing "G" saves the currently-displayed picture to disk.
The saved picture is time- and date-stamped at the bottom of
the screen. Saved picture files are given the name
"GRABxxx.RAW", where "xxx" denotes the number of the saved
picture. When WeatherMan starts up, it searches the current
directory for previously-saved pictures and sets its first file
name to the next highest number to avoid overwriting old files.
When a picture is saved to disk, the timing relationships in
the PC become somewhat unsettled for fax reception. When this
occurs, you'll notice the new data being plotted will start
skewing fairly rapidly to the right. After a few such lines
are drawn, the picture will again become synchronized. You
can hasten re-synchronization by pressing BS twice, or by
clearing the screen.
<H>elp
Pressing "H" displays a command summary. No fax data is
received or displayed while the "H" command is in effect.
Press any key to exit the help screen.
<ESC> Exit WeatherMan
Pressing the escape key unconditionally exits the program;
you are not prompted to save the picture first.
<+/-> Increase/Decrease sweep delay
These keys are used to adjust the sweep delay, as explained
above.
[VII] The SHOWPIC program
Having saved a bunch of pictures to disk, it would be nice to see what
they looked like again, wouldn't it? That's the purpose of SHOWPIC
and its syntax is
SHOWPIC [-p] <picture file> <picture file>...
where the optional -p switch loads a palette from the file SHOWPIC.PAL.
The format of SHOWPIC.PAL is the same as in lines 7 through 22 of the
configuration file. See the sample palette file for details.
Example 1:
SHOWPIC GRAB0.RAW GRAB11.RAW GRAB2.RAW
displays the pictures GRAB0.RAW, GRAB11.RAW, and GRAB2.RAW consecutively
using the built-in gray-scale palette.
Example 2:
SHOWPIC -p GRAB1.RAW TEST.RAW
displays the two given pictures using the palette contained in SHOWPIC.PAL.
You can move to the next picture in the set at any time by pressing any key.
WeatherMan's RAW picture file format is exceedingly simple, consisting
of a file of 640*480=307,200 bytes, with each byte representing a
color number in the 0 to 15 range. The file is a record of consecutive
pixel values starting at the upper left-hand side of the screen (0,0)
and extending to the lower right-hand side (639,479). This format
should make it easy for you to write your own programs for manipulating
captured picture data.
The utility program RAW2PCX.EXE (see section [VIII]) can be used to
convert the RAW format into the PCX format used by many PC
paint/image-processing programs.
[VIII] The RAW2PCX program
To convert a picture file to a PCX graphics file use either of the commands
RAW2PCX <input file name>, or
RAW2PCX <input file name> <output file name>
Example 1:
RAW2PCX GRAB0.RAW
This command creates a new file "GRAB0.PCX" in the PCX format.
Example 2:
RAW2PCX GRAB0.RAW TEST.PCX
Same result as in Example 1, but the output file is named "TEST.PCX"
instead.
Warning: RAW2PCX will overwrite any existing file having the same
name as the output file.
*****
[IX] WXDEMO.EXE
Wefax broadcasts have a very distinctive sound and once you've heard
one, you'll probably never forget what it sounds like; unfortunately,
the sound is difficult to describe in words. That's where the WXDEMO
program comes in.
Syntax:
WXDEMO <picture file>
WXDEMO takes a single argument, the name of a picture file, then
simulates the reception of the picture through your sound card and on
your monitor. If you've never heard a fax transmission before, WXDEMO
should help you learn what to listen for as you tune through the
shortwave bands. Keep in mind that this simulated reception will be
noisier than the original signal-- this results from approximating
the original 8-bit audio values by the 4-bit pixel values.
[Appendix 1] Weather Facsimile Frequencies.
The following is a very small list of stations that transmit weather
photos and charts during the day. It is not at all inclusive: there
are literally dozens of other stations across the HF bands.
(All frequencies are in kilohertz.) If you have Internet access, drop
me a line at paulhtc@netcom.com and I'll be happy to send you a larger
list.
Frequency (KHz) Location
--------- ---------
6453 California
8682 California
9090 California
11090 Hawaii
16135 Hawaii
8080 Virginia
15959 Virginia
20015 Virginia
[Appendix 2] Troubleshooting Q&A
What WeatherMan is and isn't:
WeatherMan is a program to decode and display radiofax signals, nothing
more and nothing less. When presented with a high-quality, low-noise
signal, the program will reproduce a fairly good image of the transmitted
picture.
WeatherMan does not, in any way, enhance the receiving capabilites of
a shortwave receiver. In fact, the opposite is probably true-- Computers
and their peripherals are notorious for generating broad-spectrum
radio-frequency interference. It is entirely likely that you will
not be able to receive some stations while the computer is running,
even stations that would otherwise be received just fine.
Several things can be done to improve reception: Locate the radio and
its antenna as far from the computer as possible. Use a high-output
microphone. Use a good long-wire antenna. Don't use a light-dimmer,
electric motors, or fluorescent lights near the radio or its antenna.
Pray that the ionosphere cooperates-- all the usual stuff.
I should also mention the possibility of taping fax transmissions
while the computer is off for decoding and displaying at a later time.
While common audio tape decks have insufficient speed regulation
to be very useful in this regard, some modern VCRs are also designed
to function as high-quality audio recorders. (I have a Toshiba VCR that
I've used for just this purpose.) If you decide to try this, you'll
probably have to change the sweep delay number to achieve good results.
VCRs are fairly precise instruments, but they're not always accurate
with regard to playback timing.
Now on to the questions.
Q: Why isn't anything being displayed?
Make certain your radio is turned on and the BFO is activated.
Check the connection between the radio output and sound card mic
input. If you have an SBPro, an SB16, or a MediaVision PAS16 card,
use the appropriate mixer command to set the microphone level to
maximum sensitivity before running WeatherMan.
Q: Why does the picture look like a photo negative?
Either you have loaded a reversed palette in the configuration file
or you are tuned to the wrong sideband. Adjust the file or the BFO
accordingly.
Q: Why is the picture grainy?
The signal may be weak, or there may be a source of interference nearby,
such as an electric motor, fluorescent light, or the like. Use a good
antenna and/or increase the mic input level, and/or remove the source
of the noise.
Q: Why is the picture "ghosty"?
Just like television, if a signal is received along two or more paths
having different effective lengths, you'll get ghosts. There's no
cure, except perhaps to re-orient the receiving antenna.
Q: Why are there 30 wavy vertical lines across the picture?
You're picking up 60 Hz (power line) interference from somewhere,
possibly from a ground-fault loop. Try transformer-coupling the
receiver to the sound card and make sure you're using a good quality
shielded cable.
Q: I've set the "sweep delay" constant. Why do my pictures still come
out slightly skewed at times?
Because of variations in sound card sampling rates and since the PC's
internal clock has a finite resolution, it's unlikely that your pictures
will come out perfectly square. However, any skewing in which the
picture is off by more than a few pixels is an indication that the
sweep delay constant is not properly adjusted.
Q: I get great reception until I turn on the computer. What gives?
The computer is a wonderful source of radio waves. Keep the antenna
as far as possible from the computer and connect it to your radio
with coax. The coax shield should be connected to a good ground.
Q: When my radio is on, why do I hear Skippy the Clown urging me to
do bad things?
Uh huh... That's kind of out of my area of expertise...
[Appendix 3] Supported Sound Cards
WeatherMan has been tested extensively using the following sound cards:
1. Sound Blaster 1.5
2. Sound Blaster Pro
3. Sound Blaster 16
4. ProAudio Spectrum 16 (PAS16)
The program *may* run on other "100% Sound Blaster compatible" cards,
but I can't guarantee that it will. At the present time, I intend to
support only the cards listed above.
[Appendix 4] About the Sample Pictures
The sample pictures were received using the following extremely
non-ideal setup:
Radio : Radio Shack DX-440
Sound Card : ProAudio Spectrum 16, Sound Blaster Emulation
Antenna : 25-ft. random wire antenna, located indoors
Location : Third floor of an apartment building
Problems : 1) antenna only 6 ft. from computer
2) power company transformer about 50 ft away
from computer.
Even with the setup above, I think the pictures are pretty good; I'll
leave it up to you to imagine what they might have been like using an
excellent shortwave receiver and a good antenna.
***************
Thanks for trying WeatherMan!